package com.aode.playlist.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MutableLiveData;

import com.aode.common.bean.request.SearchData;
import com.aode.common.bean.response.Music;
import com.aode.common.bean.web.Result;
import com.aode.playlist.repository.Repository;

import java.util.List;

public class HomePlayListViewModel extends AndroidViewModel {
    private Repository repository;
    public HomePlayListViewModel(@NonNull Application application) {
        super(application);
        this.repository = new Repository(application);
    }

    public void getMusic(SearchData searchData){
        repository.getMusic(searchData);
    }

    public MutableLiveData<Result<List<Music>>> getMusicLiveData(){
        return repository.getMusicMutableLiveData();
    }

}
